From 8d33c7bd67ac768366a793bdba747a7bf1f0b8a7 Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Thu, 17 May 2018 15:59:00 +0200 Subject: [PATCH] Update help --- help/help_functions.md | 70 +++++++++++++++++++++++++++++++++------ help/help_list_series.md | 6 +++- help/help_list_servers.md | 3 ++ help/help_show.md | 3 ++ 4 files changed, 71 insertions(+), 11 deletions(-) diff --git a/help/help_functions.md b/help/help_functions.md index cb3adaae..e89328ae 100644 --- a/help/help_functions.md +++ b/help/help_functions.md @@ -2,6 +2,16 @@ Aggregate functions =================== SiriDB supports multiple build-in aggregation and filter functions. Using these functions can be useful to reduce network traffic. Note that multiple functions can be combined using the arrow `=>` sign. (see `help select` for more information on how to use and combine functions) +Most aggregation function accept an optional `ts` argument. When not providing the `ts` argument, SiriDB will usually return the last timestamp in the result. One exception is the `first()` function which will return the first timestamp instead. + +For example: + + # Select the last time-stamp and the average over all values. + select mean() from `my_series` + + # Select the first time-stamp and first value: + select first() from `my_series` + List of supported aggregation and filter functions: limit @@ -24,7 +34,7 @@ count ----- Syntax: - count(ts) + count([ts]) Returns an integer value. @@ -39,7 +49,7 @@ sum --- Syntax: - sum(ts) + sum([ts]) Returns an integer or float value depending on the series data type. @@ -55,7 +65,7 @@ max --- Syntax: - max(ts) + max([ts]) Returns an integer or float value depending on the series data type. @@ -71,7 +81,7 @@ min --- Syntax: - min(ts) + min([ts]) Returns an integer or float value depending on the series data type. @@ -87,7 +97,7 @@ mean ---- Syntax: - mean(ts) + mean([ts]) Returns a float value. @@ -103,7 +113,7 @@ median ------ Syntax: - median(ts) + median([ts]) Returns a float value. @@ -113,7 +123,7 @@ median_high ----------- Syntax: - median_high(ts) + median_high([ts]) Returns an integer or float value depending on the series data type. @@ -123,7 +133,7 @@ median\_low ----------- Syntax: - median_low(ts) + median_low([ts]) Returns an integer or float value depending on the series data type. @@ -133,7 +143,7 @@ variance -------- Syntax: - variance(ts) + variance([ts]) Returns a float value. @@ -143,7 +153,7 @@ pvariance --------- Syntax: - pvariance(ts) + pvariance([ts]) Returns a float value. @@ -205,3 +215,43 @@ Example: # Select all positive values from 'series-001' select filter(> 0) from 'series-001' + + +first +----- +Syntax: + + first([ts]) + +Returns the first value in each `ts` time window. (Or just the first value) + +Example: + + # Select the first value from 'series-001' + select first() from 'series-001' + + # Select the first value per day from 'series-001' + select first(1d) from 'series-001' + + # Select the first value in 2018 from 'series-001' + select first() from 'series-001' after '2018' + + +last +---- +Syntax: + + last([ts]) + +Returns the last value in each `ts` time window. (Or just the last value) + +Example: + + # Select the last value from 'series-001' + select last() from 'series-001' + + # Select the last value per day from 'series-001' + select last(1d) from 'series-001' + + # Select the last value in 2017 from 'series-001' + select last() from 'series-001' before '2018' \ No newline at end of file diff --git a/help/help_list_series.md b/help/help_list_series.md index fdd103a7..570e24d6 100644 --- a/help/help_list_series.md +++ b/help/help_list_series.md @@ -26,7 +26,11 @@ Series can be matched using different methods. Groups can help to quickly get th syntax: - [update_function ] + <*/all | series_name | regular_expression | group> [update_function ] + +*/all +----- +All series are selected. series name ----------- diff --git a/help/help_list_servers.md b/help/help_list_servers.md index 9c1ba7a9..2603aca5 100644 --- a/help/help_list_servers.md +++ b/help/help_list_servers.md @@ -13,11 +13,14 @@ columns Valid columns are: - active_handles: Returns the active handles which can be used as an indicator on how busy a server is. +- active_tasks: Returns the active tasks for the current database. - address: Server address. - buffer_path: Path where this server keeps the buffer file. - buffer_size: Size the server uses for one series in the buffer. - dbpath: Path where the server stores the database. - fifo_files: Number of fifo files which are used to update the replica server. This value is 0 if the server has no replica. A value greater than 1 could be an indication that replication is not working. +- idle_percentage: Returns percentage of idle time since the database was loaded. +- idle_time: Returns the idle time in seconds since the database was loaded. - ip_support: IP Support setting on the server. (ALL/ IPV4ONLY/ IPV6ONLY) - libuv: Version of libuv library. - log_level: Current loglevel for the server. diff --git a/help/help_show.md b/help/help_show.md index 665229c2..a9883eb6 100644 --- a/help/help_show.md +++ b/help/help_show.md @@ -8,6 +8,7 @@ Syntax See available options for more info on each show command: - `show active_handles`: Returns the active handles which can be used as an indicator for how busy a server is. +- `show active_tasks`: Returns the active tasks for the current database. - `show buffer_path`: Returns the local buffer path on *this* server. - `show buffer_size`: Returns the buffer size in bytes on *this* server. - `show dbname`: Returns the database name. @@ -16,6 +17,8 @@ See available options for more info on each show command: - `show duration_log`: Returns the sharding duration for log data on *this* database (not supported yet). - `show duration_num`: Returns the sharding duration for num data on *this* database. - `show fifo_files`: Returns the number of fifo files which are used to update the replica server. This value is 0 if the server has no replica. A value greater than 1 could be an indication that replication is not working. +- `show idle_percentage`: Returns percentage of idle time since the database was loaded. +- `show idle_time`: Returns the idle time in seconds since the database was loaded. - `show ip_support`: Returns the ip support setting on *this* server. - `show libuv`: Returns the version of libuv on *this* server. - `show list_limit`: Returns the maximum value which can be used as limit in a list query. -- 2.30.2